package com.yidianyanglao.core.exception;

import com.yidianyanglao.core.enums.Code;

/**
 * 自定义异常
 * 所有非正常逻辑都需抛出次异常
 */
public class CustomException extends RuntimeException {

    private Code code;
    public CustomException(Code code, String msg) {
        super(msg);
        this.code = code;
    }

    public CustomException(Code code, String msg, Throwable t) {
        super(msg,t);
        this.code = code;
    }

    public Code getCode() {
        return code;
    }

    public void setCode(Code code) {
        this.code = code;
    }

}
